package ter.find.pattern;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

import javax.swing.JOptionPane;

public class ReadWriteFile {
	
	String path;
	String data;
	
	
	public void saveToFile(String data,String path) throws IOException{
		  Writer output = null;
		  File file = new File(path);
		  output = new BufferedWriter(new FileWriter(file));
		  output.write(data);
		  output.close();
		  JOptionPane.showMessageDialog(null, "Données enrregistrer dans: \n"+path);
		  System.out.println("File successfully saved");  
	}
	
	public void loadFile(String file,String path){
		
	}
}


